package com.starblink.preferenceconfig.bean

import com.starblink.rocketreserver.ListPreferenceConfigABTestQuery.PreferenceList
import com.starblink.rocketreserver.ListPreferenceConfigQuery
import com.starblink.rocketreserver.ListSimilarPreferenceBrandConfigQuery.ListSimilarPreferenceBrandConfig

/**
 * 品牌Bean
 * @note 因为多个接口返回的偏好Bean类型不同
 */
data class PreferenceBrand constructor(val id: Int, val name: String?, val image: String?) {
    public var isChecked = false // 是否已选择
    public var isGotSimilarBrand = false //是否已获取相似品牌

    constructor(brand: PreferenceList) : this(
        (brand.id!! as Double).toInt(),
        brand.name,
        brand.image
    )

    constructor(brand: ListPreferenceConfigQuery.ListPreferenceConfig) : this(
        brand.id!! as Int,
        brand.name,
        brand.image
    )

    constructor(brand: ListSimilarPreferenceBrandConfig) : this(
        brand.id!! as Int,
        brand.name,
        brand.image
    ){
        isGotSimilarBrand = true
    }
}